Skip to content

ci: isolation install-check + fix lite-bootstrap[litestar] import#159

Merged
lesnik512 merged 3 commits into
mainfrom
extra-isolation-install-check
Jul 19, 2026
Merged

ci: isolation install-check + fix lite-bootstrap[litestar] import#159
lesnik512 merged 3 commits into
mainfrom
extra-isolation-install-check

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Summary

The bare-core typing_extensions crash (1.3.1) exposed that CI only ever installs --all-extras — so an extra that imports a package it doesn't declare passes CI while breaking a real single-extra install. A per-extra isolation sweep confirmed a second instance of this class and motivates a systemic guard.

Full rationale: planning/changes/2026-07-19.04-extra-isolation-install-check.md.

What changed

  • Fix lite-bootstrap[litestar] crashing on import. litestar_bootstrapper.py imported litestar.plugins.prometheus (which imports prometheus_client) under the is_litestar_installed guard, but the litestar extra doesn't install prometheus-client — only litestar-metrics does. So pip install lite-bootstrap[litestar]; import lite_bootstrap raised litestar's MissingDependencyException. The import is now guarded by prometheus_client too (its only uses are inside the metrics instrument, already gated on that package). Ships as 1.3.2.
  • New install-isolation CI job. For bare core + each of the 28 extras: clean venv → uv pip install .[extra]import lite_bootstrap, on Python 3.10 (the floor). Collects all failures and fails listing them (set +e so an inherited errexit can't abort the loop early). A parity check pins the job's extras list to pyproject.toml.

Testing

  • TDD regression test (with sys.modules eviction so it genuinely reproduces); just test 216 passed, 100% coverage; just lint-ci clean.
  • The sweep that motivated this ran locally across all 28 extras on 3.10 and 3.12: only the litestar family was broken; everything else imports clean.
  • Independent Opus review (reproduced the pre-fix failure in a worktree): ready to merge.

🤖 Generated with Claude Code

lesnik512 and others added 3 commits July 19, 2026 17:36
Add a CI job installing each extra in isolation and importing lite_bootstrap
(the --all-extras suite masks undeclared transitive deps), and fix the litestar
bug it found: litestar.plugins.prometheus is imported under is_litestar_installed
but needs prometheus_client, so lite-bootstrap[litestar] crashed on import.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…lient

litestar_bootstrapper imported litestar.plugins.prometheus (which imports
prometheus_client) under the is_litestar_installed guard, but the `litestar`
extra does not install prometheus-client — only `litestar-metrics` does. So
`pip install lite-bootstrap[litestar]` + `import lite_bootstrap` crashed with
litestar's MissingDependencyException. Guard the import on prometheus_client too;
its only uses are inside the metrics instrument, already gated on that package.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The existing suite only installs --all-extras, so an extra that imports an
undeclared package passes CI while breaking a real single-extra install (shipped
twice: the bare-core typing_extensions crash and litestar/prometheus). Add a job
that, per extra, installs .[extra] into a clean venv and imports lite_bootstrap,
failing with the full list of any that break. Python 3.10 (the floor).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lesnik512
lesnik512 merged commit 56ba454 into main Jul 19, 2026
11 checks passed
@lesnik512
lesnik512 deleted the extra-isolation-install-check branch July 19, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant